package com.farmer.service;

import com.farmer.pojo.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.farmer.utils.Result;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;


/**
* @author 86183
* @description 针对表【user(用户信息表)】的数据库操作Service
* @createDate 2024-04-18 09:30:26
*/
public interface UserService extends IService<User> {

    Result add(User user);

    Result deleteUser(Integer id);

    /*
    * 用户解封*/
    Result deblock(Integer id);

    Result update(User user);

    Result getById(Integer id);

    Result getAll();

    /*
    * 根据标题模糊查询*/
    Result getByTitleLike(String name);

    Result login(User user);

    Result getUserInfo(String token);

    Result checkUserName(String username);

    Result register(User user);

    Result updatePassword(String token, String newPassword);

//    Result avatarInsert(String token,MultipartFile file) throws IOException;

    Result avatarInsert(Integer id, MultipartFile file, String username, String name, String phone, String email, String level);

    Result getAvatar(Integer id);


    /*
     * 分页查询*/
    Result page(Integer pageNum, Integer pageSize);
}
